cmake_minimum_required (VERSION 2.8)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")

set(LIBLQR_SRC lqr.cpp matfunction.cpp tools.cpp)
add_library(lqr SHARED ${LIBLQR_SRC})

target_link_libraries(lqr)

add_library(lqr_static STATIC ${LIBLQR_SRC})
set_target_properties(lqr_static PROPERTIES OUTPUT_NAME "lqr")

set_target_properties(lqr PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(lqr_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

set_target_properties(lqr PROPERTIES VERSION 1.0 SOVERSION 1)

install(TARGETS lqr lqr_static
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib)

install(FILES lqr.h tools.h matfunction.h DESTINATION include/lqrsolver)
